package tech.yangzhijie.login.service.impl;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tech.yangzhijie.login.mapper.TGroupMapper;
import tech.yangzhijie.login.pojo.TGroup;
import tech.yangzhijie.login.pojo.TGroupExample;
import tech.yangzhijie.login.service.GroupService;
import tech.yangzhijie.login.vo.GroupVo;


@Service
public class GroupServiceImpl implements GroupService {

	@Autowired
	private TGroupMapper tGroupMapper;
	
	@Override
	public List<GroupVo> findGroupList() {
		TGroupExample example = new TGroupExample();
		List<TGroup> glist = tGroupMapper.selectByExample(example);
		List<GroupVo> vlist = new ArrayList<>();
		for (TGroup tGroup : glist) {
			GroupVo vo = new GroupVo();
			BeanUtils.copyProperties(tGroup, vo);
			vlist.add(vo);
		}
		return vlist;
	}

}
